Skip to content

Feature/gh35 implement sc show#36

Open
BenjiMilan wants to merge 5 commits intodevelopfrom
feature/gh35_implement_sc_show
Open

Feature/gh35 implement sc show#36
BenjiMilan wants to merge 5 commits intodevelopfrom
feature/gh35_implement_sc_show

Conversation

@BenjiMilan
Copy link
Contributor

@BenjiMilan BenjiMilan commented Mar 2, 2026

Closes #35

Implement sc show functionality:

sc show branch
sc show tag
sc show tags
sc show repo_flow_config
sc show group
sc show log

We already added sc show tag and sc show tags as sc tag show and sc tag list in a previous ticket and therefore we are just piping these commands to those functions.

@BenjiMilan BenjiMilan requested a review from TB-1993 March 2, 2026 15:12
@BenjiMilan BenjiMilan self-assigned this Mar 2, 2026
Copilot AI review requested due to automatic review settings March 2, 2026 15:12
@BenjiMilan BenjiMilan force-pushed the feature/gh35_implement_sc_show branch 3 times, most recently from 5f07757 to 1a5f794 Compare March 2, 2026 15:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds sc show subcommands to the branching CLI to display repository/project information (branch status, gitflow config, logs, groups), and wires them into the SCBranching command dispatcher.

Changes:

  • Introduces a new show CLI group with branch, repo_flow_config, log, tag, tags, and group subcommands.
  • Adds new ShowBranch, ShowRepoFlowConfig, ShowLog, and GroupShow command implementations and exposes them via SCBranching.
  • Fixes a typo in tag listing output (“mainfest” → “manifest”).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/sc/branching_cli.py Adds sc show CLI group and subcommands; minor decorator change for tag group.
src/sc/branching/commands/show.py New command implementations for sc show branch, repo_flow_config, and log.
src/sc/branching/commands/group.py New command implementation for sc show group (list groups or show group info).
src/sc/branching/branching.py Wires new show/group commands into SCBranching and dispatching.
src/sc/branching/commands/tag.py Fixes “mainfest” typo in log output.
src/sc/branching/commands/common.py No functional change (formatting-only in the diff).
Comments suppressed due to low confidence (11)

src/sc/branching/commands/show.py:82

  • Grammar: “must be ran” should be “must be run”.
        logger.error("`sc show repo_flow_config` must be ran inside a repo project!")

src/sc/branching_cli.py:298

  • @cli.group is used without parentheses here, while every other CLI group in this file uses @cli.group(). For consistency (and to avoid any ambiguity about Click decorator behavior), consider switching back to @cli.group() unless there’s a specific reason not to.
@cli.group()

src/sc/branching_cli.py:361

  • This def tag(...) under the show group reuses the global name tag, which already refers to the top-level tag command group defined above. Even though Click has already registered the group, this shadowing is confusing and makes future refactors error-prone. Rename the function (e.g., show_tag) to avoid clobbering the tag group symbol.
@show.command()
@click.argument("tag")
def tag(tag):
    """Show information about a tag."""
    SCBranching.tag_show(tag)

src/sc/branching/commands/show.py:83

  • run_git_command() logs an error but then returns successfully. This means running sc show repo_flow_config inside a normal git repo will exit with status 0 even though it’s unsupported. Align with the base Command behavior by exiting non-zero (e.g., sys.exit(1)) or raising an exception after logging.
    def run_git_command(self):
        logger.error("`sc show repo_flow_config` must be ran inside a repo project!")

src/sc/branching/commands/group.py:80

  • The Rich-markup escaping here looks inconsistent with ShowBranch and likely renders without a closing ] (only the opening [ is escaped/printed). Consider matching the ShowBranch pattern so the lock status displays as [NORMAL] (or similar) consistently.
        logger.info(
            f"Lock Status: [bold yellow]\[{proj.lock_status or 'NORMAL'}][/]",
            extra={"markup": True}
        )

src/sc/branching/commands/group.py:21

  • Path and sys are imported here but not used in this module. Removing unused imports will avoid linter warnings and keep the module tidy.
from pathlib import Path
import subprocess
import sys

src/sc/branching/commands/group.py:35

  • Grammar: “must be ran” should be “must be run”.
        logger.error("`sc show group` must be ran inside a repo project!")

src/sc/branching_cli.py:355

  • The sc show log command has no docstring, so Click will not have a helpful --help description for this subcommand (unlike the other sc show subcommands here). Add a short docstring describing what it outputs.
def log():
    SCBranching.show_log()

src/sc/branching/commands/group.py:36

  • run_git_command() logs an error but then returns successfully. This makes sc show group inside a normal git repo appear to succeed (exit code 0) even though it’s unsupported. Align with the base Command behavior by exiting non-zero (e.g., sys.exit(1)) or raising an exception after logging.
    def run_git_command(self):
        logger.error("`sc show group` must be ran inside a repo project!")

src/sc/branching/commands/show.py:66

  • url = next(remote.urls) can raise StopIteration if a remote exists but has no configured URLs. Use a safe default (e.g., next(remote.urls, None)) and handle the missing-URL case so sc show branch doesn’t crash on misconfigured repos.
        if repo.remotes:
            remote = repo.remotes[0]
            url = next(remote.urls)
            remote_status = f"{remote.name}  {url}"

src/sc/branching/commands/group.py:87

  • url = next(remote.urls) can raise StopIteration if a remote exists but has no configured URLs. Use a safe default (e.g., next(remote.urls, None)) and handle the missing-URL case so sc show group doesn’t crash on misconfigured repos.
        if repo.remotes:
            remote = repo.remotes[0]
            url = next(remote.urls)
            remote_status = f"{remote.name}  {url}"
        else:

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BenjiMilan BenjiMilan force-pushed the feature/gh35_implement_sc_show branch from 1a5f794 to 4d3f814 Compare March 2, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add sc show functionality

2 participants